package com.bcbim.operation_maintenance.table_head.service;

import com.bcbim.operation_maintenance.table_head.mapper.SpaceTableHeadMapper;
import com.bcbim.operation_maintenance_interface.table_head.dao.SpaceTableHeadDAO;
import com.bcbim.operation_maintenance_interface.table_head.dto.TableCheckDTO;
import com.bcbim.operation_maintenance_interface.table_head.service.SpaceTableHeadService;
import com.bcbim.operation_maintenance_interface.table_head.vo.SpaceTableHeadVO;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @version V 1.0.0
 * @Description：空间信息表头设置service实现类
 * @Author: haomeijie
 * @Date: 2022/3/9 9:51
 **/
@Service(timeout = 60 * 1000, group = "spaceTableHead", version = "1.0.0")
public class SpaceTableHeadServiceImpl implements SpaceTableHeadService {

    @Autowired
    private SpaceTableHeadMapper spaceTableHeadMapper;

    @Override
    public boolean checkSpaceTableHeadByUserId(TableCheckDTO spaceTableCheckDTO) {
        int count = spaceTableHeadMapper.checkSpaceTableHeadByUserId(spaceTableCheckDTO);
        return count > 0 ? true : false;
    }

    @Override
    public List<SpaceTableHeadVO> listSpaceTableHead(TableCheckDTO spaceTableCheckDTO) {
        return spaceTableHeadMapper.listSpaceTableHead(spaceTableCheckDTO);
    }

    @Override
    public int batchInsertSpaceTableHead(List<SpaceTableHeadDAO> list) {
        return spaceTableHeadMapper.batchInsertSpaceTableHead(list);
    }

    @Override
    public int batchNoChecked(TableCheckDTO spaceTableCheckDTO) {
        return spaceTableHeadMapper.batchNoChecked(spaceTableCheckDTO);
    }

    @Override
    public int batchUpdateSpaceTableHeadCheck(List<SpaceTableHeadDAO> list) {
        return spaceTableHeadMapper.batchUpdateSpaceTableHead(list);
    }
}
